import java.util.ArrayList;
import java.util.List;

/**
 * 
 */

/**
 * If a person gets a question while they are in a meeting, this pre-event
 * is added to their schedule
 *
 */
public class QuestionThought extends Event {

	Manager manager;
	TeamLead tl;
	Developer owner;
	List<Employee> eventMembers;
	/**
	 * @param eventTime
	 * @param member
	 */
	public QuestionThought(Time eventTime, Developer member, TeamLead lead, Manager manager) {
		super(eventTime, member);
		this.tl = lead;
		this.owner = member;
		this.manager = manager;
		eventMembers = new ArrayList<Employee>();
		eventMembers.add(member);
		if(!(member instanceof TeamLead))
		eventMembers.add((Employee) lead);
		eventMembers.add(manager);
		priority = 0;
		// TODO Auto-generated constructor stub
	}

	

	/* (non-Javadoc)
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run() {
		// TODO Auto-generated method stub
		
		
		if(owner instanceof TeamLead){
			owner.schedule.scheduleEvent(new UnansweredQuestion(owner.getSchedule().getCurrentTime(), eventMembers));
		}else {
			owner.schedule.scheduleEvent(new Question(owner.getSchedule().getCurrentTime(), eventMembers, owner.getSchedule(), owner, tl, manager));
		}
		
	}

}
